Package com.cisco.pt.ptmp.impl
Class LowLevelReadThread
java.lang.Object
java.lang.Thread
com.cisco.pt.ptmp.impl.LowLevelReadThread
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PacketTracerConnectionprotected ByteBufferprotected BlockingQueue<ByteBuffer>protected byte[]protected booleanprotected booleanprotected intFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
messageList
-
connection
-
shouldStop
protected volatile boolean shouldStop -
useBinaryEncoding
protected boolean useBinaryEncoding -
inputBuffer
-
rawBuffer
protected byte[] rawBuffer -
writePosition
protected int writePosition
-
-
Constructor Details
-
LowLevelReadThread
-
-
Method Details
-
getNextMessage
- Throws:
InterruptedException
-
shouldStop
public void shouldStop() -
run
public void run() -
readIntoRawBuffer
- Throws:
Exception
-
initializeRawBuffer
protected void initializeRawBuffer() -
hasCompleteLengthField
protected boolean hasCompleteLengthField() -
getFirstTextDelimiterIndex
protected int getFirstTextDelimiterIndex() -
extractLengthField
protected int extractLengthField() -
extract
protected byte[] extract(int length) -
getReadSize
protected int getReadSize() -
getWriteSize
protected int getWriteSize() -
growBy
protected void growBy(int lengthIncrease) -
grow
protected void grow(int length) -
show
-